const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        code: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        sapDeliveryCode: 'string',
        saleConfirmationCode: 'string',
        saleOrderCode: 'string',
        orderType: 1,
        transportType: 1,
        logisticFactoryCode: 'string',
        erpStorageLocation: 'string',
        status: 1,
        createTime: '2020-03-17T07:17:10.089Z'
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                sapDeliveryCode: 'string',
                saleConfirmationCode: 'string',
                saleOrderCode: 'string',
                orderType: 1,
                transportType: 1,
                logisticFactoryCode: 'string',
                erpStorageLocation: 'string',
                status: 1,
                createTime: '2020-03-17T07:17:10.089Z',
                brandName: 'string',
                currency: 1,
                vehicleFundsTypeCode: 'string',
                address: 'string',
                destERPStorageLocation: 'string',
                exportCountry: 'string',
                receiveAddress: 'string',
                vesselName: 'string',
                destinationPort: 'string',
                contactName: 'string',
                vinYear: 2020,
                remark: 'string',
                sapCreateDate: '2020-03-17T07:41:42.955Z',
                sapCreateTime: '2020-03-17T07:41:42.955Z',
                creatorName: 'string',
                modifierName: 'string',
                modifyTime: '2020-03-17T07:41:42.955Z',
                details: [
                    {
                        id: '1',
                        vin: 'string',
                        son: 'string',
                        productCode: 'string',
                        productName: 'string',
                        kdbomCode: 'string',
                        kdbomVersionCode: 'string',
                        quantity: 20,
                        accessoryItem: 'string'
                    }
                ],
            }
        }
    );
});

router.get('/:id/export', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
module.exports = router;
